<template>
	<view>
		<view v-if="isFixed" style="height:calc(135rpx + env(safe-area-inset-bottom));"></view>
		<view class="submitBox" :class="[isFixed ? 'fixed':'']" :style="{backgroundColor:bgColor}">
			<view class="btn btn1" hover-class="btnHover" :style="{width:(width + '%')}" @click="clickHandle">
				{{btnText}}
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"my-submitBtn",
		data() {
			return {
				
			};
		},
		props:{
			bgColor:{
				type:String,
				default:'#F7F8FA'
			},
			btnText:{
				type:String
			},
			width:{
				type:String,
				default:"80"
			},
			isFixed:{
				type:Boolean,
				default:true
			}
		},
		methods:{
			clickHandle(){
				this.$emit('click')
			}
		}
	}
</script>

<style lang="scss">
// 底部菜单
.submitBox{
	height: 130rpx;
	padding: 16rpx 16rpx 0 16rpx;
	letter-spacing: 2rpx;
	display: flex;
	justify-content: space-around;
	.btn{
		height: 80rpx;
		color: #FFFFFF;
		font-size: 30rpx;
		font-weight: 600;
		border-radius: 40rpx;
		display: flex;
		justify-content: center;
		align-items: center;
	}
	.btn1{
		background: #2BA777;
	}
	.btnHover{
		background: #37d898;
	}
}
.fixed{
	height: calc(130rpx + env(safe-area-inset-bottom));
	padding-bottom: env(safe-area-inset-bottom);
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 9999;
}
</style>